package com.wsx.ones.boot.client;

import com.alibaba.dubbo.config.annotation.Reference;
import com.wsx.ones.boot.DubboxApi;
import com.wsx.ones.boot.model.User;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wangshuaixin on 17/4/9.
 */
@Service
public class DubboxClient {

    @Reference
    private DubboxApi dubboxApi;


    public User getUser(User user) {
        Map<String, String> map = dubboxApi.getMap(new HashMap<String, String>());
        user.setId(11);
        user.setBirth(new Date());
        return user;
    }

    public List<User> getUsers(User user, Integer size) {
        user.setId(1);
        user.setBirth(new Date());
        return dubboxApi.getMores(user, size);
    }
}
